// -*- c-basic-offset: 2 default-tab-width: 2 indent-tabs-mode: t -*-
// vim: autoindent tabstop=2 noexpandtab shiftwidth=2 softtabstop=2
#ifndef _NA_H_
#define _NA_H_

#include "Const.h"

using namespace R;

template <typename T> inline
TYPE(T) getNA(){
	return NULL;
}

template <> inline
TYPE(String) getNA<String>() {
	return (char*)ConstPool::NA_STRING;
}

template <> inline
TYPE(Int) getNA<Int>() {
	return ConstPool::NA_INT;
}

template <> inline
TYPE(Double) getNA<Double>() {
	return ConstPool::NA_DOUBLE;
}

template <> inline
TYPE(Logical) getNA<Logical>() {
	return ConstPool::NA_LOG;
}

template <> inline
Any* getNA<Vector>() {
	return ConstPool::Null;
}

#endif
